package com.cykj.bean;

public class MessageBean {
    private int code;
    private String msg;
    private Object data;
    private int total;

    public MessageBean() {
    }

    public MessageBean(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public static MessageBean success(String msg,Object data){
        return new MessageBean(200,msg,data);
    }
    public static MessageBean fail(String msg){
        return new MessageBean(400,msg,null);
    }

    @Override
    public String toString() {
        return "MessageBean{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                ", total=" + total +
                '}';
    }
}
